package first

import (
	"server/application/constant/keys"
	"server/pkg/configs"
)

// SetFirstConfigValue 初始化配置key
func SetFirstConfigValue() {
	if configs.GetConf().GetString(keys.ConfigKeyMysqlUser) == "" || configs.GetConf().GetString(keys.ConfigKeyMysqlPwd) == "" {
		panic("未配置mysql信息，请先在configs.yaml中进行配置")
		return
	}
	configs.SetDefault(keys.ConfigKeyMysqlIp, "127.0.0.1")
	configs.SetDefault(keys.ConfigKeyMysqlPort, "3306")
	configs.SetDefault(keys.ConfigKeyMysqlUser, "root")
	configs.SetDefault(keys.ConfigKeyMysqlDb, "")
	configs.SetDefault(keys.ConfigKeyMysqlPwd, "123456")

	//代码生成相关
	configs.SetDefault(keys.ConfigKeyGenServeDir, "/Users/xiaod/project/geeker-admin-go/server")
	configs.SetDefault(keys.ConfigKeyGenFrontDir, "/Users/xiaod/project/geeker-admin-go/front")

}
